import Vue from 'vue'
import Router from 'vue-router'
import MailList from '@/components/mail/MailList'
import MailForm from '@/components/mail/MailForm'
import MailDetails from '@/components/mail/MailDetails'
import MailSuccess from '@/components/mail/MailSuccess'
import Mail from '@/components/Mail'

import Work from '@/components/Work'
import WorkIndex from '@/components/work/WorkIndex'
import WorkList from '@/components/work/WorkList'
import WorkInfo from '@/components/work/WorkInfo'
import WorkDeclare from '@/components/work/WorkDeclare'
import WorkHelp from '@/components/work/WorkHelp'

import Information from '@/components/Information'
import InformationList from '@/components/information/InformationList'
import InformationInfo from '@/components/information/InformationInfo'

import My from '@/components/My'
import MyLogin from '@/components/my/MyLogin'

import Xy12345 from '@/components/12345'
import Xy12345List from '@/components/12345/12345List'
import Xy12345Form from '@/components/12345/12345Form'
import Xy12345Details from '@/components/12345/12345Details'
import Xy12345Success from '@/components/12345/12345Success'

import Register from '@/components/Register'
import RegisterHospital from '@/components/register/RegisterHospital'
import RegisterDept from '@/components/register/RegisterDept'
import RegisterDoctor from '@/components/register/RegisterDoctor'
import RegisterSchedule from '@/components/register/RegisterSchedule'

Vue.use(Router)

export default [
  {
    path: '/mail',
    component: Mail,
    children: [
      {
        path: '',
        component: MailList,
        meta: { keepAlive: true } // 是否开启缓存
      },
      {
        path: 'details/:id',
        component: MailDetails
      },
      {
        path: 'form',
        component: MailForm
      },
      {
        path: 'success',
        component: MailSuccess
      }
    ]
  },
  {
    path: '/work',
    component: Work,
    children: [
      {
        path: '',
        component: WorkIndex,
        meta: { keepAlive: true } // 是否开启缓存
      },
      {
        path: 'list/:id',
        component: WorkList,
        meta: { keepAlive: true } // 是否开启缓存
      },
      {
        path: 'info/:id',
        component: WorkInfo,
        meta: { keepAlive: true } // 是否开启缓存
      },
      {
        name: 'declare',
        path: 'declare/:id',
        component: WorkDeclare
      },
      {
        name: 'workHelp',
        path: 'help',
        component: WorkHelp
      }
    ]
  },
  {
    path: '/information',
    component: Information,
    children: [
      {
        path: 'list/:website',
        component: InformationList
      },
      {
        path: 'info/:id',
        component: InformationInfo
      }
    ]
  },
  {
    path: '/my',
    component: My,
    children: [
      {
        path: 'login',
        component: MyLogin
      }
    ]
  },
  {
    path: '/12345',
    component: Xy12345,
    children: [
      {
        path: '',
        component: Xy12345List
      },
      {
        path: 'form',
        component: Xy12345Form
      },
      {
        path: 'details/:id',
        component: Xy12345Details
      },
      {
        path: 'success',
        component: Xy12345Success
      }
    ]
  },
  {
    path: '/register',
    component: Register,
    children: [
      {
        path: 'hospital',
        component: RegisterHospital,
        meta: { keepAlive: true } // 是否开启缓存
      },
      {
        path: 'dept/:id',
        component: RegisterDept,
        meta: { keepAlive: true } // 是否开启缓存
      },
      {
        path: 'doctor/:id',
        component: RegisterDoctor
      },
      {
        path: 'schedule/:id',
        component: RegisterSchedule
      }
    ]
  }
]
